generateUnrealizedSaleTxn

fun generateUnrealizedSaleTxn(secAcct: Account, shares: Long, asofDate: Int): SplitTxn

Generate a sale transaction as if all remaining shares of a security were sold off as of a specific date. This method should be used for securities using the average cost method.

Return

A hypothetical sale of all remaining shares as of the given date.

Parameters

secAcct

The security account.

shares

The share balance as of the given date.

asofDate

The date to compute the hypothetical sale for.


Generate a sale transaction as if all remaining shares of a security were sold off as of a specific date. This method should be used for securities using lot-based cost tracking.

Return

A hypothetical sale of all remaining shares as of the given date.

Parameters

secAcct

The security account.

lotsRemaining

A list of the remaining lots to be sold, or null to use average cost basis.

asofDate

The date to compute the hypothetical sale for.